/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.edu.gobesco.entityes;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author: Edwin Chía
 * @Fecha: 20/10/2011
 */
@Entity
@Table(name = "TIPO_PERSONA")
@NamedQueries({
    @NamedQuery(name = "TipoPersona.findAll", query = "SELECT t FROM TipoPersona t ORDER BY t.descripcion")})
public class TipoPersona implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_TIPOPERSONA")
    private BigDecimal idTipopersona;
    @Basic(optional = false)
    @Column(name = "DESCRIPCION")
    private String descripcion;

    public TipoPersona() {
    }

    public TipoPersona(BigDecimal idTipopersona) {
	this.idTipopersona = idTipopersona;
    }

    public TipoPersona(BigDecimal idTipopersona, String descripcion) {
	this.idTipopersona = idTipopersona;
	this.descripcion = descripcion;
    }

    public BigDecimal getIdTipopersona() {
	return idTipopersona;
    }

    public void setIdTipopersona(BigDecimal idTipopersona) {
	this.idTipopersona = idTipopersona;
    }

    public String getDescripcion() {
	return descripcion;
    }

    public void setDescripcion(String descripcion) {
	this.descripcion = descripcion;
    }


    @Override
    public int hashCode() {
	int hash = 0;
	hash += (idTipopersona != null ? idTipopersona.hashCode() : 0);
	return hash;
    }

    @Override
    public boolean equals(Object object) {
	// TODO: Warning - this method won't work in the case the id fields are not set
	if (!(object instanceof TipoPersona)) {
	    return false;
	}
	TipoPersona other = (TipoPersona) object;
	if ((this.idTipopersona == null && other.idTipopersona != null) || (this.idTipopersona != null && !this.idTipopersona.equals(other.idTipopersona))) {
	    return false;
	}
	return true;
    }

    @Override
    public String toString() {
	return "co.com.edu.gobesco.entityes.TipoPersona[idTipopersona=" + idTipopersona + "]";
    }

}
